<?php


class Application_Model_Time extends Zend_Db_Table_Abstract {

    protected $_name = 'Time';

    public function getDays() {
        $sql = "SELECT DISTINCT Date FROM Time";
        return $this->getAdapter()->query($sql)->fetchAll();
    }
    
    /**
     * Function to add a new time to the database
     * 
     * @param Beginning The start time
     * @param End The end time
     * @param Date The date of the timeslot
     */
    public function addTime($Beginning, $End, $Date) {
		$sql = "INSERT INTO Time (Time_ID, Beginning, End, Date) VALUES (NULL, :beg, :end, :date)";
		$param = array(":beg" => $Beginning, ":end" => $End, ":date" => $Date);
		$this->getAdapter()->query($sql,$param);
	}
    
}

?>
